<% @page_title = "View book infomation" %>
<%= stylesheet_link_tag "admin/view-item", :media => "all" %>
<style>
	label {
		width: 80px !important;
	}
	
	.image img {
		box-shadow: 1px 1px 4px #000;
		-webkit-box-shadow: 1px 1px 4px #000;
		-moz-box-shadow: 1px 1px 4px #000;
	}
	
	div.actions {
		margin: 30px 0 30px 95px;
	}
</style>
<div class="view-book-info">
	<h1>View book information - <%= @book.title %></h1>
	<div class='content'>
		<div class='image'>
			<%= image_tag(@book.image_url) %>
		</div>
		<div class='infors'>
			<p>
				<label><strong>ID:</strong></label>&nbsp;
				<%= @book.id %>
			</p>
			<p>
				<label><strong>Author:</strong></label>&nbsp;
				<%= @book.author %>
			</p>
			<p>
				<label><strong>Publisher:</strong></label>&nbsp;
				<%= @book.publisher %>
			</p>
			<p>
				<label><strong>Price:</strong></label>&nbsp;
				<%= @book.price %>
			</p>
			<p>
				<label><strong>Quantity:</strong></label>&nbsp;
				<%= @book.quantity %>
			</p>
			<p>
				<label><strong>Available:</strong></label>&nbsp;
				<%= @book.free_quantity %>
			</p>
			<p>
				<label><strong>Description:</strong></label>&nbsp;
				<span class='text'><%= @book.description %></span>
			</p>
			<p>
				<label><strong>Category:</strong></label>&nbsp;
				<%= @book.book_category.category_name %>
			</p>
			<p>
				<label><strong>Created Date:</strong></label>&nbsp;
				<%= @book.created_at %>
			</p>
			
			<div class='actions'>
				<%= link_to "Edit", :controller => "admin/book", :action => "edit", :id => @book.id %>
				<%= link_to "Delete", :controller => "admin/book", :action => "delete", :id => @book.id, :method => "delete", :data => {:confirm => "Are you sure?"} %>
				<%= link_to "Back", :controller => "admin/book", :action => "index" %>
			</div>
		</div><!-- End .infors -->
	</div><!-- End. content -->
</div>
<div class='clear'></div>